package com.ht.interfaces.request;

import com.ht.api.db.annotate.FuncGroup;
import com.ht.api.db.annotate.FuncId;
import com.ht.api.db.annotate.FuncName;
import com.ht.api.db.annotate.FuncParam;
import com.ht.api.db.annotate.FuncParams;
import com.ht.api.db.annotate.FuncQuery;
import com.ht.api.db.bean.AjaxResult;
import com.ht.api.db.bean.DataResult;
import com.ht.api.db.bean.SessionBean;
import com.ht.api.db.enums.Param;
import com.ht.api.db.request.IHandleRequest;
import com.ht.api.db.util.HtUtil;
import com.ht.interfaces.utils.CallTestUtil;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@FuncId("")
@FuncGroup("")
@FuncParams({
	@FuncParam(name = "主键ID", code = "main_id", value = "3658544228915814895"),
	@FuncParam(name = "对象", code = "data", value = """
			{
	            "key": "main_id",
	            "val": "11"
	        }
			""", type = Param.OBJ),
	@FuncParam(name = "数组", code = "list", value = """
			[
		        {"main_id": 1875172928660836352},
		        {"main_id": 1875175148143906816}
		    ]
		""", type = Param.ARRAY),
})

@FuncQuery("")
@FuncName("")
public class DemoCommonCall implements IHandleRequest {

	@Override
	public void before(SessionBean me, JSONObject param, DataResult result) {

	}

	@Override
	public void after(SessionBean me, JSONObject param, DataResult result) {

	}

	public static void main(String[] args) {
		System.err.println("@FuncId>>" + HtUtil.getId());

//		JSONObject result = CallTestUtil.autoTest(new Object(){}.getClass().getEnclosingClass().getSimpleName());
//		System.err.println(result.toStringPretty());
	}
}
